<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <script src=" https://code.angularjs.org/1.6.4/angular.js">

    </script>

    <style>
        input.ng-invaild{
            background-color: lightblue;
        }
    </style>

</head>

<body>

   <form ng-app="" name="myForm" ng-init="text = 'test@runoob.com'">
      输入你的名字:
      <input name="myAddress" ng-model="text" required>
      Email:
      <input type="email" name="myAddress" ng-model="text" required>
      <span ng-show="myForm.myAddress.$error.email">不是一个合法的邮箱地址</span>
      <h1>状态</h1>
        {{myForm.myAddress.$valid}}
        {{myForm.myAddress.$dirty}}
        {{myForm.myAddress.$touched}}
   </form>

   <p>在输入框中输入你的邮箱地址，如果不是一个合法的邮箱地址，会弹出提示信息。</p>
</body>

</html>